<?php
/**
 * JoosFish - Multi Lingual extention and translation manager for Joostina CMS
 * Copyright (C) 2011 Joostina Team
 * 
 * @name JoosFish
 * @copyright © 2011 Joostina team, © 2003-2007 Think Network GmbH, Munich
 * @license GNU General Public License version 2
 * @version 1.8.2.1
 * @package Joostina
 *
 * Based on the source code of Joom!Fish 1.8.2 copyrighted by Think
 * Network GmbH, Munich. The main contribution is made by developers of
 * Joom!Fish project, but the main reason behind making JoosFish an alongside
 * project is to maintain it's compatibility with Joostina CMS 1.3.x
 * 
 * For full copyright note see documetation/COPYRIGHT.php
 * 
 * For changes see documentation/CHANGELOG.php
 *
 * The "GNU General Public License" (GPL) is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * -----------------------------------------------------------------------------
 * $Id: uninstall.joomfish.php 8 2011-06-30 08:23:14Z hnatt88@gmail.com $
 *
*/

// Don't allow direct linking
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

function com_uninstall()
{
	global $database;
	
	// uninstall modules
	$database->setQuery( "DELETE FROM `#__modules` WHERE `module`= 'mod_jflanguageselection';");
	$database->query();
	@unlink( mosMainFrame::getBasePath()."/modules/mod_jflanguageselection.css" );
	@unlink( mosMainFrame::getBasePath()."/modules/mod_jflanguageselection.php" );
	@unlink( mosMainFrame::getBasePath()."/modules/mod_jflanguageselection.xml" );
	
	$database->setQuery( "DELETE FROM `#__modules` WHERE `module`= 'mod_translate';");
	$database->query();
	@unlink( mosMainFrame::getBasePath()."/administrator/modules/mod_translate_no.png" );
	@unlink( mosMainFrame::getBasePath()."/administrator/modules/mod_translate.php" );
	@unlink( mosMainFrame::getBasePath()."/administrator/modules/mod_translate.png" );
	@unlink( mosMainFrame::getBasePath()."/administrator/modules/mod_translate.xml" );
	
    
    // uninstall bots
	$database->setQuery( "DELETE FROM `#__mambots` WHERE `element`like 'jf%.searchbot';");
	$database->query();
    @unlink( mosMainFrame::getBasePath()."/mambots/search/jfcategories.searchbot.php" );
    @unlink( mosMainFrame::getBasePath()."/mambots/search/jfcategories.searchbot.xml" );
    @unlink( mosMainFrame::getBasePath()."/mambots/search/jfcontact.searchbot.php" );
    @unlink( mosMainFrame::getBasePath()."/mambots/search/jfcontact.searchbot.xml" );
    @unlink( mosMainFrame::getBasePath()."/mambots/search/jfcontent.searchbot.php" );
    @unlink( mosMainFrame::getBasePath()."/mambots/search/jfcontent.searchbot.xml" );
    @unlink( mosMainFrame::getBasePath()."/mambots/search/jfcontact.searchbot.php" );
    @unlink( mosMainFrame::getBasePath()."/mambots/search/jfcontact.searchbot.xml" );
    @unlink( mosMainFrame::getBasePath()."/mambots/search/jfnewsfeeds.searchbot.php" );
    @unlink( mosMainFrame::getBasePath()."/mambots/search/jfnewsfeeds.searchbot.xml" );
    @unlink( mosMainFrame::getBasePath()."/mambots/search/jfsections.searchbot.php" );
    @unlink( mosMainFrame::getBasePath()."/mambots/search/jfsections.searchbot.xml" );
    @unlink( mosMainFrame::getBasePath()."/mambots/search/jfweblinks.searchbot.php" );
    @unlink( mosMainFrame::getBasePath()."/mambots/search/jfweblinks.searchbot.xml" );
    
    
    $database->setQuery( "DELETE FROM `#__mambots` WHERE `element`= 'jfdatabase.systembot';");
	$database->query();
    @unlink( mosMainFrame::getBasePath()."/mambots/system/jfdatabase.systembot.php" );
    @unlink( mosMainFrame::getBasePath()."/mambots/system/jfdatabase.systembot.xml" );

    $database->setQuery( "DELETE FROM `#__mambots` WHERE `element`= 'jfalternative';");
	$database->query();
    @unlink( mosMainFrame::getBasePath()."/mambots/content/jfalternative.php" );
    @unlink( mosMainFrame::getBasePath()."/mambots/content/jfalternative.xml" );

	echo "<strong>Joom!Fish was uninstalled successfully.</strong></p>";
	echo "All Bot's are uninstalled";
}

?>